<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

</body>
<script>
    //将函数返回出去执行
    function wrap() {
        var test = "test";
        return function() {
            console.log(test)
        }
    }
    var inner = wrap()
    inner()

    //有异步回调的参与
    function wrap2() {
        var test = "test";
        setTimeout(function () {
            console.log(test)
        },1000)
    }
    wrap2()

</script>
</html>